package com.molichuxing.gateway.bff.permission.services.impl;

import com.molichuxing.framework.dto.Paged;
import com.molichuxing.framework.exception.BizException;
import com.molichuxing.gateway.bff.permission.convertor.Convert;
import com.molichuxing.gateway.bff.permission.entity.request.OperationLogCreateVo;
import com.molichuxing.gateway.bff.permission.entity.response.AccountLoginVo;
import com.molichuxing.gateway.bff.permission.entity.response.OperationLogVo;
import com.molichuxing.gateway.bff.permission.services.AccountBffService;
import com.molichuxing.gateway.bff.permission.services.OperationLogBffService;
import com.molichuxing.gateway.utils.TokenUtil;
import com.molichuxing.gateway.utils.entity.DealerEntity;
import com.molichuxing.gateway.utils.entity.UserEntity;
import com.molichuxing.services.business.dto.response.AccountLoginBizDto;
import com.molichuxing.services.business.service.AccountBizService;
import com.molichuxing.services.infrastructure.service.OperationLogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

@Service("operationLogBffService")
public class OperationLogBffServiceImpl implements OperationLogBffService {

	private static final Logger logger = LoggerFactory.getLogger(OperationLogBffServiceImpl.class);


	@Resource
	private OperationLogService operationLogService;

	@Override
	public Boolean createOperationLog(OperationLogCreateVo createVo) throws Exception{
		return operationLogService.createOperationLog(Convert.toOperationLogCreateDto(createVo));
	}

	@Override
	public Paged<OperationLogVo> getOperationLogByDealerId(Map<String, Object> map, Integer pageNum, Integer pageSize) {
		return Convert.toOperationLogVoPage(operationLogService.getOperationLogByDealerId(map, pageNum, pageSize));
	}
}
